package com.vic.test.aop;

import java.util.Date;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.DeclareParents;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class GreetingAspect {

	@Around("@annotation(com.vic.test.aop.Tag)")
	public Object around(ProceedingJoinPoint joinPoint) throws Throwable{
		System.out.println("--------before------" + new Date().getTime());
		joinPoint.proceed();
		System.out.println("--------after------" + new Date().getTime());
		return "123";
	}
	
	@DeclareParents( value = "com.vic.test.aop.GreetingImpl", defaultImpl = OtherImpl.class)
	public Other other;
	
	

}
